#pragma once

#include <string>
#include <iostream>
#include <GL\glui.h>

using namespace std;

class Illumination
{
private:
	GLfloat ambient[4];
	GLfloat background[4];
	int doublesided, local;
public:
	Illumination() {}
	
	void setValues(int ds, int loc)
	{
		doublesided = ds;
		local = loc;
	}

	void setAmbient(float r, float g, float b, float a)
	{
		ambient[0] = r;
		ambient[1] = g;
		ambient[2] = b;
		ambient[3] = a;
	}

	void setBackground(float r, float g, float b, float a)
	{
		background[0] = r;
		background[1] = r;
		background[2] = r;
		background[3] = r;
	}

	GLfloat*  getAmbient()
	{
		return ambient;
	}

	GLfloat* getBackground()
	{
		return background;
	}

	void applyIllumination()
	{
        glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,doublesided);
        glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER,local);
        glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
		glClearColor(background[0], background[1], background[2], background[3]);
	}
};